package com.es;

/**
 * 描述:
 * MyBatis-
 *
 * @author Derek
 * 创建时间：2022-05-07 10:35
 */
public enum OpEnum {
    SAVE(100, "保存"), UPDATE(101, "更新"), DELETE(102, "删除"),
    LIST(103, "列表"), GET(104, "获取"), LIST_BY_CONDITION(105, "有条件的列表");;

    private int code;
    private String title;

    private OpEnum(int code, String title) {
        this.code = code;
        this.title = title;
    }

    public static OpEnum getOpEnum(int code){
        OpEnum[] opEnums = OpEnum.values();
        for (int i = 0; i < opEnums.length; i++) {
            if(opEnums[i].code == code){
                return opEnums[i];
            }
        }
        return null;
    }
}
